package cn.wusifx.zabbix.request.builder;

import cn.wusifx.zabbix.request.BaseRequest;

import java.util.HashMap;
import java.util.Map;

public abstract class GetRequestBuilder extends RequestBuilder<Map<String,Object>> {
    public GetRequestBuilder(String method, String auth) {
        super(method, auth);
        baseRequest.setParams(new HashMap<>());
    }

    public GetRequestBuilder(String method, Long id, String auth) {
        super(method, id, auth);
        baseRequest.setParams(new HashMap<>());
    }

    public GetRequestBuilder setParam(String key, Object value){
        baseRequest.getParams().put(key,value);
        return this;
    }

    public GetRequestBuilder setParams(Map<String,Object> params){
        baseRequest.getParams().putAll(params);
        return this;
    }

    @Override
    public BaseRequest<Map<String, Object>> builder() {
        return baseRequest;
    }
}
